package com.example.javabasic.thread.classone.demo5;

import java.util.Collection;

public interface Lock  {

    static class TimeOutException extends Exception{
        public TimeOutException(String message){
            super(message);
        }
    }

    //锁
    void lock() throws InterruptedException;
    //锁时长
    void lock(long milles) throws InterruptedException,TimeOutException;
    //解锁
    void unLock();
    //被阻塞的线程
    Collection<Thread> getBlockedThreads();
    //被阻塞线程个数
    int getBlockedSize();

}
